﻿using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;

namespace HiStaff.Control
{
    [ToolboxBitmap(typeof(TextBox))]
    public partial class HiTextBox : Janus.Windows.GridEX.EditControls.EditBox
    {
        bool _isRequire = false;
        private bool _readOnlyWhenEdit = false;
        private bool _searchControl = false;
        public bool SearchControl
        {
            get { return _searchControl; }
            set { _searchControl = value; }
        }
        public bool ReadOnlyWhenEdit
        {
            get { return _readOnlyWhenEdit; }
            set { _readOnlyWhenEdit = value; }
        }
        [DefaultValue(false)]
        public bool IsRequire
        {
            get
            {
                return _isRequire;
            }
            set
            {
                _isRequire = value;
                if (value)
                    this.BackColor = HiStaff.iSystem.Data.COLOR_REQUIREMENT;
                else this.BackColor = HiStaff.iSystem.Data.COLOR_NONREQUIREMENT;
            }
        }
        public string DataField { get; set; }
        public HiTextBox()
        {
            this.VisualStyle = Janus.Windows.GridEX.VisualStyle.Office2010;
        }
        protected override void OnCreateControl()
        {
            base.OnCreateControl();
        }
    }
}
